﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Alfa.Common.UnitTests.ValidationRules {
	[TestClass]
	public class StringLengthValidationRuleTest {
		[TestMethod]
		public void StringLength_WithMinAndMax_MaxGreterThanMin_ShouldSuccess( ) {
			var instance = new Alfa.Common.ValidationRules.StringLengthValidationRule( );
			instance.Min = 5;
			instance.Max = 15;
			var result = instance.Validate("Testing string", CultureInfo.CurrentCulture);
			Assert.IsTrue(result.IsValid);
		}
		[TestMethod]
		public void StringLength_WithMinAndMax_MinGreterThanMax_ShouldFail( ) {
			System.Windows.Controls.ValidationResult result = null;
			try {
				var instance = new Alfa.Common.ValidationRules.StringLengthValidationRule( );
				instance.Min = 15;
				instance.Max = 5;
				result = instance.Validate("Testing string", CultureInfo.CurrentCulture);
			} catch { }
			if (result != null)
				Assert.Fail("ShouldFail");
		}
		[TestMethod]
		public void StringLength_WithMinAndMax_TextInRange_ShouldSuccess( ) {
		}
		[TestMethod]
		public void StringLength_WithMinAndMax_TextOutOfRange_ShouldFail( ) {
		}
		[TestMethod]
		public void StringLength_WithMin_TextInRange_ShouldSuccess( ) {
		}
		[TestMethod]
		public void StringLength_WithMin_TextOutOfRange_ShouldFail( ) {
		}
		[TestMethod]
		public void StringLength_WithMax_TextInRange_ShouldSuccess( ) {
		}
		[TestMethod]
		public void StringLength_WithMax_TextOutOfRange_ShouldSuccess( ) {
		}
		[TestMethod]
		public void StringLength_WithoutMinAndMax_Text_ShouldSuccess( ) {
		}
	}
}
